<template>
  <button class="key" @click="onClick" :disabled="disabled" :class="{disabled: disabled}">
    {{num}}
  </button>
</template>

<script>
export default {
  name: "single_key",
  props:{
    num: null,
    disabled: false,
  },
  methods:{
    onClick(){
      if(!this.disabled){
        this.$emit('click', (this.num).toString())
      }
    },

  }
}
</script>

<style scoped lang="scss">
.key{
  box-sizing: border-box;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  font-size: 28px;
  line-height: 1.5;
  background-color: #fff;
  border-radius: 8px;
  cursor: pointer;
  flex:1;
  width: 100%;
  border: none;
  user-select: none;
  margin-bottom: 12px;
  &:active{
    background-color: #ebedf0;
  }
  &.disabled{
    background-color: #f7f8fa;
    color: #c8c9cc;
  }

}
</style>